import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import {getPhotoInfo} from "@/util/ApiUtil.ts";
import photoControl from "@/page/MainPage/classes/PhotoControl.ts";

const start = async () => {
    // 需要被立即加载的ajax数据
    await getPhotoInfo().then((data) => {
        photoControl.photoInfo = data
        photoControl.setContainer(Math.floor(Math.random() * data.length))
        photoControl.updateContainer()
    })
    ReactDOM.createRoot(document.getElementById('root')!).render(
        // <React.StrictMode>
        <App />
        // </React.StrictMode>,
    )
}

start().then()
